import { mapGetters } from "vuex";
export default{
	computed: {
		...mapGetters('m_cart',['total']),
	},
	onShow(){
		this.setBadge()
	},
	methods: {
		setBadge(){
			this.total? uni.setTabBarBadge({index: 2,text: this.total+''}).catch(err => err):uni.removeTabBarBadge({index: 2})
		}
	},
	watch: {
		total(){
			this.setBadge()
		}
	}
}